home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.xa;
-
- import com.extensibility.app.DialogFactory;
- import com.extensibility.app.UI;
- import com.extensibility.xml.BaseDeclaration;
- import com.extensibility.xml.DTDUtilities;
- import com.extensibility.xml.InternalPEDeclaration;
- import com.extensibility.xml.ParserException;
- import java.util.Enumeration;
-
- public class SchemaWin$EditTextDialog extends TextCellDialog {
- // $FF: synthetic field
- final SchemaWin this$0;
-
- public SchemaWin$EditTextDialog(SchemaWin var1, SchemaDoc var2, boolean var3) {
- super(var1, var2, (BaseDeclaration)null, var3, (String)null);
- this.this$0 = var1;
- ((CellDialog)this).setURI(((CellDialog)this).getSchemaDoc().getFocusedURI(true));
- }
-
- public SchemaWin$EditTextDialog(SchemaWin var1, SchemaDoc var2, boolean var3, String var4) {
- super(var1, var2, (BaseDeclaration)null, var3, (String)null);
- this.this$0 = var1;
- if (var4 != null) {
- ((CellDialog)this).setText(var4);
- super.orgValue = var4;
- }
-
- }
-
- protected void doDelete() {
- String var1 = ((CellDialog)this).getCellOwner();
- SchemaDoc var2 = ((CellDialog)this).getSchemaDoc();
- InternalPEDeclaration var3 = (InternalPEDeclaration)var2.getNamedDeclaration(DTDUtilities.convertPEName(var1, false), Class.forName("com.extensibility.xml.InternalPEDeclaration"));
- if (!var2.isEditable(var3)) {
- DialogFactory.stop(this, UI.getString("stop.foreign.uri", ((BaseDeclaration)var3).getURI().getFullName()));
- } else {
- Enumeration var4 = var2.getUsedBy(var3);
- if (var4.hasMoreElements()) {
- String var6 = UI.getString("stop.delete.in.use", var1, ((BaseDeclaration)var4.nextElement()).getName());
- DialogFactory.stop(this, var6);
- } else {
- boolean var5 = DialogFactory.showConfirm(this, UI.getString("dialog.delete.pe", var1), UI.getString("dialog.delete"));
- if (var5) {
- var2.removeDeclaration(var3);
- super.doDelete();
- }
- }
- }
- }
-
- protected boolean doSave() {
- try {
- if (!super.doSave()) {
- boolean var8 = false;
- return var8;
- } else {
- String var1 = ((CellDialog)this).getCellOwner();
- SchemaDoc var9 = ((CellDialog)this).getSchemaDoc();
- if (((CellDialog)this).getMode() == 1) {
- var1 = DTDUtilities.convertPEName(var1, false);
- if (var9.getNamedDeclaration(var1, Class.forName("com.extensibility.xml.InternalPEDeclaration")) != null) {
- throw new ParserException(206, var1);
- }
-
- InternalPEDeclaration var3 = new InternalPEDeclaration(var1, ((CellDialog)this).getText());
- var9.ensureURI(var3);
- var9.insertDeclaration(var3, (BaseDeclaration)null);
- } else {
- var1 = DTDUtilities.convertPEName(var1, false);
- InternalPEDeclaration var10 = (InternalPEDeclaration)var9.getNamedDeclaration(var1, Class.forName("com.extensibility.xml.InternalPEDeclaration"));
- if (!var9.isEditable(var10)) {
- DialogFactory.stop(this, UI.getString("stop.foreign.uri", ((BaseDeclaration)var10).getURI().getFullName()));
- boolean var11 = false;
- return var11;
- }
-
- var10.setValue(((CellDialog)this).getText());
- }
-
- boolean var4 = true;
- return var4;
- }
- } catch (ParserException var5) {
- DialogFactory.showValidation(this, var5.getMessage(), false);
- boolean var2 = false;
- return var2;
- }
- }
- }
-